﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace WAVEZ
{
    static class TiroManager
    {
        public static List<Tiro> listaTiros = new List<Tiro>();
        public static Model modeloDosTiros;
        public static Random random = new Random();

        public static void CriarTiro(Vector3 posicao, float angulo)
        {
            //angulo = random.Next((int)(angulo - 5), (int)(angulo + 5));

            Tiro tiro = new Tiro(modeloDosTiros, angulo);
            tiro.posicao = posicao;
            listaTiros.Add(tiro);
        }

        public static void Update(GameTime gameTime)
        {
            foreach (Tiro tiroAtual in listaTiros)
            {
                tiroAtual.Update(gameTime);
            }


        }

        public static void Draw(Camera3D camera, GraphicsDevice device)
        {
            foreach (Tiro tiroAtual in listaTiros)
            {
                tiroAtual.Draw(camera, device);
            }
        }

    }
}
